// This is a javascript file
function validate(form) {
    if (form.title.value=="" || form.title.value.length < 6) {
        alert("Please fill in an event title.");
        form.title.focus();
    }
    else if (form.startDate.value=="" || form.startDate.value.length < 10) {
        alert("Please insert a valid date (mm/dd/yyyy).");
        form.startDate.focus();
    }
    else if (form.endDate.value=="" || form.endDate.value.length < 10) {
        alert("Please insert a valid date (mm/dd/yyyy).");
        form.endDate.focus();
    }
/*    else if (form.locationid.selected.value=="notlisted") {
        if(form.locationTitle.value == "" || form.locationTitle.value.length < 5){   
            alert("Please insert a title of your location.");
            form.locationTitle.focus();
        }
        else if (form.addr1.value == "" || form.addr1.value.length < 5 ){
            alert("Please insert the address of the location");
            form.addr1.focus();
        }
        else if(form.city.value == "" || form.city.value.length < 3){
            alert("Please insert a valid city name");
            form.city.focus();
        }
        
        else if(form.state.value == "" || form.state.value.length != 2 ){
            alert("Please insert a valid state abbreviaton (Ex.  GA)");
            form.state.focus();
        }
    }*/
    else{
        form.submit();
    }
}
